<?php
//var_dump($_SESSION['arr_all_staff']);
//$arr_unit = get_arr_all_unit($_SESSION['arr_all_unit']);
$v_item_unit_id = _get_root_unit_id();
$arr_unit = get_arr_all_unit($_SESSION['arr_all_unit']);
$arr_staff = get_arr_child_staff($arr_unit);
$v_count = sizeof($arr_staff);
$j=0;
for ($i=0;$i<$v_count; $i++){
	foreach($_SESSION['arr_all_staff'] as $v_staff){
		if (($arr_staff[$i]['0'] == $v_staff['id']) && (($v_staff['position_group_code'] == "LANH_DAO_PHONG_BAN") || ($v_staff['position_group_code'] == "LANH_DAO_VP"))){
				$arr_staff_handle[$j]=$arr_staff[$i];
				$j++;
		}
	}		
}
$arr_list = _attach_two_array($arr_unit,$arr_staff_handle, 5);
?>
<body scroll =yes>
<table width="100%">
	<tr>
		<td></td>
		<td colspan="2">
			<DIV STYLE="overflow: auto; height:220pt;padding-left:5px;margin:0px">
				<table width="99%" cellpadding="0" cellspacing="0">
					<tr>
						<td><?php
							$v_current_id = -1;
							$xslt=new Xslt();
							$xslt->setXmlString(_built_XML_tree($arr_list,$v_current_id,'false','home.jpg','home.jpg','user.bmp','false'));
							$xslt->setXsl("../../isa-lib/isa-function/treeview.xsl");
							if($xslt->transform()) {
								$ret=$xslt->getOutput();
								echo $ret;
							}else{
								print("Error:".$xslt->getError());
							}?>
						</td>
					</tr>				
				</table>
			</DIV>
		</td>
	</tr>
</table>
</body>